class Initalize < ActiveRecord::Migration
  def self.up
    create_table :categories, :force => true do |t|
      t.column :name, :string, :null => false
      t.column :code, :string, :null => false
      t.column :description, :string
    end

    create_table :languages, :force => true do |t|
      t.column :name, :string, :null => false
      t.column :code, :string, :null => false
    end

    create_table :books, :force => true do |t|
      t.column :title, :string, :null => false
      t.column :author, :string
      t.column :catalog_no, :string, :null => false
      t.column :isbn, :string
      t.column :category_id, :integer, :null => false
      t.column :language_id, :integer, :null => false
    end

 end

  def self.down
    drop_table :books
    drop_table :languages
    drop_table :categories
  end
end

